-
Notifications
You must be signed in to change notification settings - Fork 2.6k
MultiDbClient implementation #3696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/active-active
Are you sure you want to change the base?
Conversation
…v-multi-db-client
if database_config.client_kwargs.get("retry", None) is not None: | ||
# The retry object is not used in the lower level clients, so we can safely remove it. | ||
# We rely on command_retry in terms of global retries. | ||
database_config.client_kwargs.update({"retry": Retry(retries=0, backoff=NoBackoff())}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the user has provided concrete retry configuration we should keep it and add zero retry config only when the retry is not in the kwargs.
with self._lock: | ||
if len(self._failures_within_duration) >= self._threshold: | ||
database.circuit.state = CBState.OPEN | ||
if self._command_executor and self._command_executor.active_database: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have self._command_executor = None here? Or not having an active database?
Pull Request check-list
Please make sure to review and check all of these items:
NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Added initial implementation of MultiDBClient that allows to operate on Active-Active databases